"""twisted.web2.server related classes"""

# Copyright 2008 Ilya Novoselov
#
# This file is part of TyuChat.
#
# TyuChat is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TyuChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TyuChat.  If not, see <http://www.gnu.org/licenses/>.

#import cgitb

from twisted.web2 import server

class Request(server.Request):
    #implements(iweb.ICanHandleException)
    #def renderHTTP_exception(self, request, failure):
    #    text = cgitb.html((failure.type, failure.value, failure.tb))
    #    return http.Response(code=500, stream=text)
    pass


class Site(server.Site):
    def __call__(self, *args, **kwargs):
        return Request(site=self.resource, *args, **kwargs)